/*
 * GameDrawThread.cpp
 *
 *  Created on: 2013-1-23
 *      Author: heqiu
 */

#include "Global.h"

void GameDrawThread::stop() {
	m_bExist = true;
}
void GameDrawThread::run() {
	m_bExist = false;
	while (true) {
		if (m_bExist) {
			break;
		}
		g_GlobalData.m_pGuudScreen->white();
		g_GlobalData.m_GuudLock.lock();

		if (g_GlobalData.m_pGuudCanvasMap != NULL) {
			g_GlobalData.m_pGuudCanvasMap->draw();
		}
		if (g_GlobalData.m_pGuudCanvasControl != NULL) {
			g_GlobalData.m_pGuudCanvasControl->draw();
		}

		if (g_GlobalData.m_pGuudCanvasWelcome != NULL) {
			g_GlobalData.m_pGuudCanvasWelcome->draw();
		}
		g_GlobalData.m_GuudLock.unlock();
		g_GlobalData.m_pGuudScreen->show();
		guud_sleep(100);
	}
}

